package Practice05;

public class TotalArea {
    Geometry[] tuxing;
    double totalArea=0;
    public void setTuxing(Geometry[] t) {
        tuxing=t;
    }
    public double computerTotalArea() {
     //用循环语句让tuxing的元素调用getArea方法，并将返回的值累加到totalArea
        for(Geometry t : tuxing){
            totalArea += t.getArea();
        }
        return totalArea;
    }
}